package sqladvisor

const (
	AdviseByHostInfoAndDBNamePath             = "/api/v1/sqladvisor/advise/host-info-db"
	AdviseByHostInfoAndDBNameHTTPBodyTemplate = `{"host_ip": "%s", "port_num": %d, "db_name": "%s", "sql_text": "%s", "login_name": "%s"}`
)

type AdvisorByDBID struct {
	Token     string `json:"token" binding:"required"`
	DBID      int    `json:"db_id" binding:"required"`
	SQLText   string `json:"sql_text" binding:"required"`
	LoginName string `json:"login_name" binding:"required"`
}

// GetToken returns the token
func (ad *AdvisorByDBID) GetToken() string {
	return ad.Token
}

// GetDBID returns the db id
func (ad *AdvisorByDBID) GetDBID() int {
	return ad.DBID
}

// GetSQLText returns the sql text
func (ad *AdvisorByDBID) GetSQLText() string {
	return ad.SQLText
}

// GetLoginName returns the login name
func (ad *AdvisorByDBID) GetLoginName() string {
	return ad.LoginName
}

type AdvisorByHostInfoAndDBName struct {
	Token     string `json:"token" binding:"required"`
	HostIP    string `json:"host_ip" binding:"required"`
	PortNum   int    `json:"port_num" binding:"required"`
	DBName    string `json:"db_name" binding:"required"`
	SQLText   string `json:"sql_text" binding:"required"`
	LoginName string `json:"login_name" binding:"required"`
}

// GetToken returns the token
func (ahd *AdvisorByHostInfoAndDBName) GetToken() string {
	return ahd.Token
}

// GetHostIP returns the host ip
func (ahd *AdvisorByHostInfoAndDBName) GetHostIP() string {
	return ahd.HostIP
}

// GetPortNum returns the port number
func (ahd *AdvisorByHostInfoAndDBName) GetPortNum() int {
	return ahd.PortNum
}

// GetDBName returns the db name
func (ahd *AdvisorByHostInfoAndDBName) GetDBName() string {
	return ahd.DBName
}

// GetSQLText returns the sql text
func (ahd *AdvisorByHostInfoAndDBName) GetSQLText() string {
	return ahd.SQLText
}

// GetLoginName returns the login name
func (ahd *AdvisorByHostInfoAndDBName) GetLoginName() string {
	return ahd.LoginName
}
